//
//  SEGInviteRecordModel.m
//  ExcellentHome
//
//  Created by 揭婧雯 on 2017/3/3.
//  Copyright © 2017年 陈区. All rights reserved.
//

#import "SEGInviteRecordModel.h"

@implementation SEGInviteRecordModel

- (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    self = [super init];
    if (self) {
        _lastmonth = @"";
        _pageNo = @"";
        _lastweek = @"";
        _pageSize = @"";
        _totalSize = @"";
        _thisweek = @"";
        _thismonth = @"";
        _totalPage = @"";
        _records = [NSArray array];
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}
+ (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    return [[self alloc] initWithDictionary:dictionary];
}
- (void)setValue:(id)value forUndefinedKey:(NSString*)key
{

}

- (void)setValue:(id)value forKey:(NSString*)key
{
    if ([key isEqualToString:@"records"]) {
        NSMutableArray* _arrM = [NSMutableArray array];
        for (NSDictionary* dict in value) {
            SEGInviteRecordDetailModel* model = [SEGInviteRecordDetailModel initWithDictionary:dict];
            [_arrM addObject:model];
        }
        _records = _arrM.copy;
        return;
    }
    
    [super setValue:value forKey:key];
}

- (void)setLastmonth:(NSString*)lastmonth{
    _lastmonth = [[SEGUtils ValueToString:lastmonth]copy];
}
- (void)setPageNo:(NSString*)pageNo{
    _pageNo = [[SEGUtils ValueToString:pageNo]copy];
}
- (void)setLastweek:(NSString*)lastweek{
    _lastweek = [[SEGUtils ValueToString:lastweek]copy];
}
- (void)setPageSize:(NSString*)pageSize{
    _pageSize = [[SEGUtils ValueToString:pageSize]copy];
}
- (void)setTotalSize:(NSString*)totalSize{
    _totalSize = [[SEGUtils ValueToString:totalSize]copy];
}
- (void)setThisweek:(NSString*)thisweek{
    _thisweek = [[SEGUtils ValueToString:thisweek]copy];
}
- (void)setThismonth:(NSString*)thismonth{
    _thismonth = [[SEGUtils ValueToString:thismonth]copy];
}
- (void)setTotalPage:(NSString*)totalPage{
    _totalPage = [[SEGUtils ValueToString:totalPage]copy];
}
@end
